home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group01a.txt
/
000054_icon-group-sender _Mon Jun 12 08:47:19 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2002-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA19743
for icon-group-addresses; Mon, 12 Jun 2000 08:45:53 -0700 (MST)
Message-Id: <200006121545.IAA19743@baskerville.CS.Arizona.EDU>
From: "Frank J. Lhota" <NOSPAM.Frank.Lhota@lexma.meitech.com>
X-Newsgroups: comp.lang.icon
Subject: User defined operators for Icon
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Date: Tue, 6 Jun 2000 10:39:33 -0000
X-Trace: client 960302410 38.163.203.81 (Tue, 06 Jun 2000 10:40:10 EDT)
To: icon-group@optima.CS.Arizona.EDU
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 1042
In the thread on a Unicode version of Icon, a topic came up that deserves
more investigation. Currently, an Icon programmer can create new types in
Icon using a record declaration, e.g.
record complex( x, y )
The programmer can then write new procedures that work with the new type.
This ability to create new types is quite useful, but extending the types in
Icon is not as convenient as it could be. It is hard to integrate the new
type with the others due to the following reasons:
1. You cannot (re)define the primitive operators, such as "*", "++", or
"<", for a record type;
2. You cannot define implicit /explicit type conversions between a record
type and the existing types; and
3. You cannot define the behavior of functions such as image and write
for the new record type.
Languages such as C++ and Ada permit the programmer to define the behavior
of operators and predefined functions for user defined types. Would it be
desirable to add such a capacity to Icon? If so, what would this facility
look like?